<?php

namespace App\Console;

use App\Console\Commands\dayFloorRanking;
use App\Console\Commands\RabbitmqConsumerCommand;
use App\Console\Commands\RabbitmqProducerCommand;
use App\Console\Commands\weekFloorRanking;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
         $schedule->command(dayFloorRanking::class)->everyMinute();
         $schedule->command(weekFloorRanking::class)->everyTwoMinutes();
//         $schedule->command(RabbitmqProducerCommand::class)->everyTwoMinutes();
//         $schedule->command(RabbitmqConsumerCommand::class)->everyTwoMinutes();
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
    /**
     * 获取计划事件默认使用的时区
     *
     * @return \DateTimeZone|string|null
     */
    protected function scheduleTimezone()
    {
        return 'Asia/Shanghai';
    }
}
